package org.iabako.client.ui.page.user;

import org.iabako.client.navigation.NavigationController;
import org.iabako.client.tools.IabakoAsyncCallback;
import org.iabako.client.ui.form.AbstractForm;
import org.iabako.client.ui.form.user.userconfiguration.MyUserForm;
import org.iabako.shared.entity.business.AbstractEntity;
import org.iabako.shared.entity.user.User;

/**
 * Created by jose on 24/03/15.
 */
public class UserModify extends MyUserForm {

    public UserModify(AbstractForm parentForm) {
        super(true);
        this.parentForm = parentForm;
        title.setLabel("user_modify_form_title");

        String[] params = NavigationController.getInstance().getParams();

        userServiceAsync.getById(Long.parseLong(params[0]), new IabakoAsyncCallback<AbstractEntity>() {
            public void onSuccess(AbstractEntity result) {
                setUser((User) result);
                super.onSuccess(result);
            }
        });

    }
}
